package 
{	
	import flash.utils.getQualifiedClassName;
	import flash.xml.XMLDocument;
	import flash.xml.XMLNode;
	public function discoverAttributesByScheme( p_list: Array , p_xml: XML ):Array
	{
		var result :Array = new Array();
		var node : * ;
		for each( var p_node : String in p_list ) {
			node = node != undefined ? node[p_node] : p_xml[p_node];
		}
		if (node[0] == undefined || node[0] == null) {
			throw new Error( Log.ERROR_XML_NO_NODES);
		}
		var prop : String
		try {
			for ( var i : String in node[0].attributes() ) {
				prop = node[0].attributes()[i].name();
				if ( prop == "text" ) {
					continue;
				}
				result.push( prop );
			}	
		}
		catch (e:Error) {
			throw new Error( Log.ERROR_XML_NO_ATTRIBUTES + e.message);
		}
		result.push("text");
		return result;
	}
}